package com.hnucm.onlinealgstudy.controller;

import com.hnucm.onlinealgstudy.pojo.News;
import com.hnucm.onlinealgstudy.service.NewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "/oasadapi/news")
public class NewsController {
    @Autowired
    NewsService newsService;
    // 获取消息轮播数据
    @GetMapping
    public List<News> getNewsList(){
        return newsService.getNewsList();
    }
}
